package org.example.Service.ServiceImpl;

import org.example.Service.AuthorService;
import org.example.mapper.AuthorsMapper;
import org.example.pojo.Authors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AuthorServiceImpl implements AuthorService {
    @Autowired
    private AuthorsMapper authorMapper;


    @Override
    public void addAuthor(Authors a) {
        authorMapper.addAuthor(a);
    }

    @Override
    public void deleteAuthor(int id) {
        authorMapper.deleteAuthor(id);
    }

    @Override
    public void updateAuthor(Authors a) {
        authorMapper.updateAuthor(a);
    }

    @Override
    public Authors selectOneAuthor(int id) {
        return authorMapper.selectOneAuthor(id);
    }

    @Override
    public List<Authors> selectAllAuthor() {
        return authorMapper.selectAllAuthor();
    }
}
